//
//  UIScrollView+TGMPullToRefresh.h
//  WengWeng5
//
//  Created by HanFeng on 14-3-17.
//  Copyright (c) 2014年 mafengwo. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIScrollView+SVPullToRefresh.h"
#import "UIScrollView+SVInfiniteScrolling.h"
#import "TGMBasePullToRefreshView.h"
#import "TGMBaseLoadMoreView.h"

@protocol TGMPullToRefreshDelegate <NSObject>

// MUST be subclass of TGMBasePullToRefreshView
- (Class)tgm_classForPullToRefreshView:(UIScrollView *)scrollView;
// MUST be subclass of TGMBaseLoadMoreView
- (Class)tgm_classForLoadMoreView:(UIScrollView *)scrollView;

- (UIEdgeInsets)tgm_ScrollViewExpectedContentInset:(UIScrollView *)scrollView;

- (void)tgm_ScrollViewDidPullToRefresh:(UIScrollView *)scrollView byUser:(BOOL)byUser;
- (void)tgm_ScrollViewDidLoadMore:(UIScrollView *)scrollView;

@end

@interface UIScrollView (TGMPullToRefresh)

@property (nonatomic, weak) id <TGMPullToRefreshDelegate> tgm_delegateForPullToRefresh;

- (void)tgm_initializePullToRefreshWithDelegate:(id<TGMPullToRefreshDelegate>)delegateForPullToRefresh
                                       userInfo:(id)userInfo;

- (void)tgm_clearPullToRefresh;

- (void)tgm_stopPullToRefreshAnimating;
- (void)tgm_stopLoadMoreAnimating;

@property (nonatomic, readonly) TGMBasePullToRefreshView *tgm_refreshView;
@property (nonatomic, readonly) TGMBaseLoadMoreView *tgm_loadMoreView;

@end
